<?php include("../Service/WebClass/member/SiteEditClass.php");
	session_start();
	$siteEdit = new SiteEdit;
	$siteEdit->mytask(); 
	
if($_SESSION["memberId"] == null || $_SESSION["memberId"] == "")
{
	header("Location:../login.php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>サイト編集画面</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../css/common.css" type="text/css" />
<script language="JavaScript" src="../js/common.js" type="text/javascript"></script>
<script>
// 編集ボタンをクリックした処理
function doEditClick(siteId) {
	document.getElementById("act").value = "edit";
	document.getElementById("paramSiteId").value = siteId;
	document.getElementById("inputform").submit();	
	//window.location = "SiteEditDetail.php?siteId=" + siteId;	
}
// チェックボックスをクリックした処理
function changeCheckBox() {
	var totalNum = document.getElementById("rowCount").value;
	if (totalNum == 0) return;
	var checkStatus = document.getElementById("headCheckBox").checked;
	for(var i=0;i<totalNum;i++) {
		var checkBoxId = "bodyCheckBox" + i;
		document.getElementById(checkBoxId).checked = checkStatus;
	}
}
// 新規ボタンをクリックした処理
function doInsert() {
	// 新規のactを設定
	document.getElementById("act").value = "insert";
	document.getElementById("inputform").submit();	
}
// 削除フラグをクリックした処理
function doDelete() {
	// 削除のactを設定
	document.getElementById("act").value = "delete";
	document.getElementById("inputform").submit();	
}
</script>

</head>
<body bgcolor="#F4FFE4">
<?php include("../head.php") ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">

 <tr>
    <td width="165" valign="top" bgcolor="#5C743D"><?php include("../menu.php");?></td>
    <td width="813" colspan="2" align="center" valign="top">
    <br />
    <form name="inputform" id="inputform" method="post">
	<?php
    echo "<input type=hidden name=act id=act value=submit>";
    echo "<input type=hidden name=paramSiteId id=paramSiteId >";
	echo $siteEdit->rowCountHtml;
    ?>
      <table width="100%" border="0" cellpadding="2" cellspacing="0">
        <tbody>
          <tr>
            <td width="36%" align="left">&nbsp;</td>
            <td align="right">
            
            <td width="64%" align="right"><input type="button" name="insert" class="btn new" onclick="javascript:doInsert()"/><input type="button" name="delete" onclick="javascript:doDelete();" class="btn del"></td>
          </tr>
        </tbody>
      </table>
	 <?php
		if($siteEdit->errorMessage != null && $siteEdit->errorMessage != "")
		echo "<font id=errorMsg name=errorMsg color=red>".$siteEdit->errorMessage."</font><br>";
	  ?>
      <table width="100%" border="1" cellpadding="4" cellspacing="0" class="tbl">
        <tbody>
        <tr align="center" class="tr2"  >
        <td width="5%"><strong>
            ID            </strong></td>
        	<td ><strong>
            サイト名            </strong></td>
        	<td width="22%"><strong>
            サイトURL            </strong></td>
           	  <td width="23%"><strong>
            サイト内容            </strong></td>
           	  <td width="10%"><strong>
            ジャンル            </strong></td>
            <td width="10%"><strong>
              月間<br />
              ﾍﾟｰｼﾞﾋﾞｭｰ</strong></td>
            <td width="11%"><strong>
            月間<br />
            ﾕﾆｰｸﾕｰｻﾞｰ            </strong></td>
            <td width="5%">
            <input id="headCheckBox" name="headCheckBox" type="checkbox" value="111" onClick="changeCheckBox()"/>            </td>
        </tr>		
         <!-- <tr class="tr4" >
           <td align="center">
            1            </td>
            <td width="14%" align="left"><input type="button" class="btn_ico btn_edit" title="編集" value="" onclick="window.location = 'SiteEditDetail.html'">
           
            動画サイト            </td>
           	  <td align="left">
            http://www.douga.co.jp            </td>
                    	<td align="left">
            動画は満載！            </td>
                    	<td align="left">
            動画            </td>
            <td align="right">
            1,200            </td>
            <td align="right">
            87            </td>
            <td align="center">
            <input name="" type="checkbox" value="" />            </td>
            </tr>
            <tr class="tr3" >
           <td align="center">
            2            </td>
            <td align="left"><input type="button" class="btn_ico btn_edit" title="編集" value="" onclick="window.location = 'SiteEditDetail.html'"/>
         
            動画サイト            </td>
                    	<td align="left">
            http://www.douga.co.jp            </td>
                    	<td align="left">
            動画は満載！            </td>
                    	<td align="left">
            動画            </td>
            <td align="right">
            1,200            </td>
            <td align="right">
            87            </td>
            <td align="center">
            <input name="" type="checkbox" value="" />            </td>
            </tr>-->
			<?php echo $siteEdit->siteInfoList;?>
        </tbody>		
      </table>
      <table width="100%" cellpadding="4" cellspacing="0">
        <tr align="right"> 
        	<td align="right">
				<?php echo "<label id='fromToPage' name='fromToPage'>".$siteEdit->fromToPage."</label>";?>
				<?php echo "<label id='siteInfoCount' name='siteInfoCount'>".$siteEdit->siteInfoCount."</label>";?>
			<td>
				<?php echo $siteEdit->pageNums;?>
			</td>  
   		</tr>
   	</table>
      </form>
    <br />
    </td>

  </tr>
 </table>
<?php include("../foot.php");?>
</body>
</html>